﻿<?xml version="1.0" encoding="utf-8" ?> 
<Feature id="Localization" name="Localization Support">
	<Dependencies>
		<Dependency type="feature">BaseFrameworkFeature.xml</Dependency>
	</Dependencies>

	<BusinessObjects>
		<BusinessObject type="TimeZone" key="id">
			<Field name="id" type="String" />
			<Field name="name" type="String" />
			<Field name="hoursFromUTC" type="Integer" />
		</BusinessObject>
		<BusinessObject type="Culture" key="browserCode">
			<Field name="browserCode" type="String" />
			<Field name="dotNetBaseCulture" type="String" />
			<Field name="parentId" type="String" />
			<Field name="country" type="Country" />
			<Field name="translationId" type="Guid" />
		</BusinessObject>
		
		<BusinessObject type="Country" key="regionCode">
			<Field name="regionCode" type="String" />
			<Method name="name" language="jscript.NET">return self.getItem('englishName');</Method>
			<Field name="englishName" type="String" />
			<Field name="nativeName" type="String" />
		</BusinessObject>

		<BusinessObject type="Translation" key="id">
			<Field name="id" type="Guid" />
			<Field name="name" type="String" />
			<Field name="translators" type="List(User)" />
			<Field name="language" type="Language" />
			<Field name="dateCreated" type="Date" />
			<Field name="visibleToChildCompanies" type="Boolean" />
			<Field name="texts" type="List(TranslationText)" />
			<Field name="autoTranslate" type="Boolean" />
		</BusinessObject>

		<BusinessObject type="Language" key="id">
			<Field name="id" type="Guid" />
			<Field name="iso6392" type="String" />
			<Field name="regionCode" type="String" />
			<Field name="englishName" type="String" />
			<Field name="nativeName" type="String" />
			<Field name="iso6391" type="String" />
			<Method name="displayName" language="jscript.NET"><![CDATA[
				var n = self.getItem("nativeName")==""?self.getItem("englishName")
					:self.getItem("nativeName") + " (" + self.getItem("englishName") + ")";
				return n;
			]]></Method>
		</BusinessObject>

		<BusinessObject type="TranslationText" key="textId">
			<Field name="textId" type="Guid"><NULL/></Field>
			<Field name="translationId" type="Guid"><NULL/></Field>
			<Field name="text" type="String" />
		</BusinessObject>

		<BusinessObject type="TranslationTextSet" key="textId">
			<Field name="textId" type="Guid"><NULL/></Field>
			<Field name="base" type="TranslationText" />
			<Field name="trans" type="TranslationText" />
		</BusinessObject>
		
		<BusinessObject type="ActiveCulture">
			<Field name="culture" type="Culture" />
			<Field name="translation" type="Translation" />
		</BusinessObject>
	</BusinessObjects>

	<BusinessObjects>
		<BusinessObject type="UiControlField" key="viewName,fieldName">
			<Field name="native" type="TranslationText" />
			<Field name="default" type="TranslationText" />
			<Field name="translated" type="TranslationText" />
			<Field name="viewName" type="String" />
			<Field name="fieldName" type="String" />
		</BusinessObject>

		<BusinessObject type="UiView" key="name">
			<Field name="name" type="String" />
			<Field name="title" type="String" />
			<Field name="visibleForTranslation" type="Boolean" />
			<Field name="fields" type="List(UiControlField)" />
		</BusinessObject>
	</BusinessObjects>

	<BusinessObjects>
		<BusinessObject injects="UserSettings" >
			<Field name="translationId" type="Guid"><NULL/></Field>
			<Field name="defaultTimeZone" type="TimeZone"/>
			<Field name="iso6392" type="String" />
		</BusinessObject>
    
    <BusinessObject injects="CompanySettings" >
      <Field name="defaultTimeZone" type="TimeZone"/>
      <Field name="translationId" type="Guid"><NULL/></Field>
      <Field name="showBuiltInTranslation" type="Boolean" />
    </BusinessObject>
  </BusinessObjects>

	<ApplicationData>
		<Entry name="BuiltInCulture" type="IBizObj.Culture">
			<Culture browserCode="en" dotNetBaseCulture="en" translationId="b5dfbfb4-7ad1-4db0-b015-014fe37f84df" />
		</Entry>
		<Entry name="BuiltInTranslation" type="IBizObj.Translation">
			<Translation id="b5dfbfb4-7ad1-4db0-b015-014fe37f84df">
				<language id="b5dfbfb4-7ad1-4db0-b015-014fe37f84df" iso6392="eng" regionCode="en" englishName="English"/>
			</Translation>
		</Entry>
	</ApplicationData>
</Feature>